package com.practice.math;

public class Finder {
	public final static void main(String[] args) {
		new Finder().run();
	}
	
	private void run() {
		int N = 100;
		
		for (int x=1; x<N; x++) {
			for (int y=x; y<N; y++) {
				for (int z=y; z<N; z++) {
					int s = x + y + z;
					int t = x*x + y*y + z*z;
					
					int t2 = 0;
					for (int x2=x+1; x2<N; x2++) {
						t2 = x2*x2;
						for (int y2=x2; y2<N; y2++) {
							int z2 = s - x2 - y2;
							if (z2 < y2) break;
							
							if (t == t2 + y2*y2 + z2*z2) {
								System.out.println("(" + x + ", " + y + ", " + z + ")" + " ~ (" + x2 + ", " + y2 + ", " + z2 + ")");
							}
						}
					}
					
				}
			}
		}
	}
}
